package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Message数据管理 */
public class MessageDBModel extends AbstractDBModel<MessageDBModel, MessageEntity>
{
    private static MessageDBModel instance;

    public static MessageDBModel getInstance() {
        if (instance == null) {
            instance = new MessageDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Message.data";
    }

    /** 创建实体 */
    @Override
    protected MessageEntity MakeEntity(GameDataTableParser parse)
    {
        MessageEntity entity = new MessageEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.Msg = parse.GetFieldValueToUTF8String("Msg");
        entity.Module = parse.GetFieldValueToUTF8String("Module");
        entity.Description = parse.GetFieldValueToUTF8String("Description");
        return entity;
    }
}
